-- IS_CAVE_HIDE_LIMIT_BONUS
-- 检查是否需要限制次数的奖励

return function(class, eventBonus)
    if type(eventBonus) ~= "table" then
        return false;
    end

    local bonus = eventBonus["bonus"] or {};

    if class == 794 then
        bonus = ME.user.dbase:query("hide_shelf_bonus") or {};
    end

    if #table.keys(bonus) <= 0 then
        return false;
    end

    if type(bonus[1]) == "number" then
        bonus = {bonus,};
    end

    -- 奖励过滤
    for _, arr in pairs(bonus) do
        if arr[2] == "gem" and table.indexOf({792, 794, 791, 759, 776, 793}, class) ~= -1 then
            return true;
        elseif arr[2] == 7155 and 762 == class then
            return true;
        elseif arr[2] == 7156 and 763 == class then
            return true;
        elseif arr[2] == 1512 and table.indexOf({780, 795}, class) ~= -1 then
           return true;
        end
    end

    return false;
end